package com.webapp.domain.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

import com.alibaba.fastjson.annotation.JSONField;
/**
 * 积分
 * @author administrator
 *
 */
@Entity
public class Integral extends BaseEntity {
	
	private Long id;
	private BigDecimal score;
	private Date createDate;
	
	private List<IntegralChange> IntegralChanges;
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public BigDecimal getScore() {
		return score;
	}
	public void setScore(BigDecimal score) {
		this.score = score;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	@OrderBy(value="desc")
	@OneToMany(mappedBy="integral",cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@JSONField(serialize = false)
	public List<IntegralChange> getIntegralChanges() {
		return IntegralChanges;
	}
	public void setIntegralChanges(List<IntegralChange> integralChanges) {
		IntegralChanges = integralChanges;
	}
	

	
	
}
